package com.wish.g04.renting.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wish.g04.base.dto.SfContractDTO;
import com.wish.g04.base.entity.CwPaymentPlan;
import com.wish.g04.base.entity.SfContract;
import com.wish.g04.base.service.ICwPaymentPlanService;
import com.wish.g04.base.service.ISfContractService;
import com.wish.g04.common.core.web.controller.BaseController;
import com.wish.g04.renting.service.TSfTerminationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 这个类的作者是123
 * 开发的日期是：2022/06/04
 **/
@Service
public class TSfTerminationServiceimpl extends BaseController implements TSfTerminationService {
    @Autowired
    ISfContractService iSfContractService;
    @Autowired
    ICwPaymentPlanService iCwPaymentPlanService;

    @Override
    public List<SfContract> searchContractList(SfContractDTO SfContractDTO) {
        return null;
    }

    @Override
    public SfContract selectSearchById(Long sfContractId) {
        return iSfContractService.getById(sfContractId);
    }

    @Override
    public List<CwPaymentPlan> selectcwPaymentPlanList(Long sfContractId, int index) {
        QueryWrapper<CwPaymentPlan> queryWrapper = new QueryWrapper();
        queryWrapper.eq("contract_id",sfContractId);
        queryWrapper.eq("contract_type",index);
        List<CwPaymentPlan> list = iCwPaymentPlanService.list(queryWrapper);
        return list;
    }

    @Override
    public void UpdateState(Long sfContractId) {

    }
}
